package com.kcht.np.service;

import java.awt.image.BufferedImage;

/**
  * <p>
  * 验证码  Service 接口
  * </p>
  *
  * @Package:        com.kcht.np.mp.service
  * @Description:    验证码  Service 接口
  * @Author:         liuqi
  * @CreateDate:     2020/3/31 22:25
 */

public interface VerifyCodeService {

    /**
     * 生成并保存到redis({codeKey,BufferedImage.getText})随机图形验证码
     */
    BufferedImage generateAndSaveImgVerifyCode(String codeKey);

    /**
     * 根据{codekey}删除redis中的键值
     */
    void delImgVerifyCode(String codeKey);

    /**
     * 根据{codeKey}拿到redis中的图片验证码,
     * 比对{userCodeText}
     */
    boolean checkVerifyCode(String codeKey, String userCodeText);

}
